using System;
using System.Collections.Generic;
using ContentRenderingApi.NodeData;
using ContentRenderingApi.Exceptions;

namespace ContentRenderingApi.Node
{
    /// <summary/>
    internal class ContentNode : AbstractNode
    {
        private string _content;

        /// <summary/>
        internal ContentNode(
            AbstractNode parent,
            string content)
            : base(parent)
        {
            this._content = content;
        }

        /// <summary/>
        internal override AbstractNode AddParentSubstitutionTag(int level)
        {
            throw new NodeDoesNotHaveContainerException();
        }

        /// <summary/>
        internal override AbstractNode AddParentTransparentTag(int level)
        {
            throw new NodeDoesNotHaveContainerException();
        }
        
        /// <summary/>
        internal override AbstractNode AddParentIfTag(int level)
        {
            throw new NodeDoesNotHaveContainerException();
        }

        /// <summary/>
        internal override AbstractNode AddParentIfNotTag(int level)
        {
            throw new NodeDoesNotHaveContainerException();
        }

        /// <summary/>
        internal override void AddParentOutputTag(int level)
        {
            throw new NodeDoesNotHaveContainerException();
        }

        /// <summary/>
        internal override AbstractNode AddChildSubstitutionTag(string name)
        {
            throw new NodeDoesNotHaveContainerException();
        }

        /// <summary/>
        internal override AbstractNode AddChildTransparentTag(string name)
        {
            throw new NodeDoesNotHaveContainerException();
        }

        /// <summary/>
        internal override AbstractNode AddChildIfTag(string name)
        {
            throw new NodeDoesNotHaveContainerException();
        }

        /// <summary/>
        internal override AbstractNode AddChildIfNotTag(string name)
        {
            throw new NodeDoesNotHaveContainerException();
        }

        /// <summary/>
        internal override void AddChildOutputTag(string name)
        {
            throw new NodeDoesNotHaveContainerException();
        }

        /// <summary/>
        internal override AbstractNode AddRootSubstitutionTag(string name)
        {
            throw new NodeDoesNotHaveContainerException();
        }

        /// <summary/>
        internal override AbstractNode AddRootTransparentTag(string name)
        {
            throw new NodeDoesNotHaveContainerException();
        }

        /// <summary/>
        internal override AbstractNode AddRootIfTag(string name)
        {
            throw new NodeDoesNotHaveContainerException();
        }

        /// <summary/>
        internal override AbstractNode AddRootIfNotTag(string name)
        {
            throw new NodeDoesNotHaveContainerException();
        }

        /// <summary/>
        internal override void AddRootOutputTag(string name)
        {
            throw new NodeDoesNotHaveContainerException();
        }

        /// <summary/>
        internal override void AddContent(string content)
        {
            throw new NodeDoesNotHaveContainerException();
        }

        /// <summary/>
        internal override bool IsContent() 
        {
            return true;
        }

        /// <summary/>
        internal override bool IsOutputTag() 
        {
            return false;
        }

        /// <summary/>
        internal override bool IsSubstitutionTag() 
        {
            return false;
        }

        /// <summary/>
        internal override bool IsTransparentTag()
        {
            return false;
        }

        /// <summary/>
        internal override bool IsIfTag()
        {
            return false;
        }

        /// <summary/>
        internal override bool IsIfNotTag()
        {
            return false;
        }

        /// <summary/>
        internal override bool IsParentTag()
        {
            return false;
        }

        /// <summary/>
        internal override bool IsRootTag()
        {
            return false;
        }

        /// <summary/>
        internal override bool IsChildTag() 
        {
            return false;
        }

        /// <summary/>
        internal override string Name 
        {
            get { throw new NodeDoesNotHaveTagException(); }
        }

        /// <summary/>
        internal override int ParentLevel 
        {
            get { throw new NodeDoesNotHaveTagLevelException(); } 
        }

        /// <summary/>
        internal override string Content 
        {
            get { return this._content;} 
        }

        /// <summary/>
        internal override IEnumerator<AbstractNode> FetchChildNodes()
        {
            throw new NodeDoesNotHaveContainerException();
        }
    }
}
